<?php


//   Copyright 2008 johnboyproductions.com
//
//   Licensed under the Apache License, Version 2.0 (the "License");
//   you may not use this file except in compliance with the License.
//   You may obtain a copy of the License at
//
//       http://www.apache.org/licenses/LICENSE-2.0
//
//   Unless required by applicable law or agreed to in writing, software
//   distributed under the License is distributed on an "AS IS" BASIS,
//   WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
//   See the License for the specific language governing permissions and
//   limitations under the License.

//
// Make sure the PHP session path has the right permissions. Use the following
// to show all warnings and errors:
//
//	ini_set('display_errors', '1');
//	error_reporting(E_ALL);
//
session_start();
if (!isset($_SESSION['user']))
{
	header('Location: login.php');
}

$query_userinfo = "SELECT * FROM users WHERE user_email = '".$_SESSION['user']."'";
$row_userinfo= $sdb->select("users", $query_userinfo);
$totalRows_userinfo = count($row_userinfo);

function set_msg($msg)
{
	$_SESSION['msg'] = $msg;
}

function display_msg()
{
	echo $_SESSION['msg'];

	unset($_SESSION['msg']);
}

$dis = none;
if (isset($_SESSION['msg']))
{
	$dis = block;
}

$contactcount = $sdb->select("contacts", "SELECT * FROM contacts");
$contactcount = count($contactcount);

$na = '<span style="color:#CCCCCC">N/A</span>';
?>